package com.it.data_tree.tree.binarySearchTree;

/**
 * @Author: CaoYouGen
 * @DateTime: 2023/04/17/12:15
 * @注释: 搜索二叉树
 **/
public class BSTNode {
    int key;
    Object value;
    BSTNode left;
    BSTNode right;
    
    public BSTNode (int key) {
        this.key = key;
    }
    
    public BSTNode (int key, Object value) {
        this.key = key;
        this.value = value;
    }
    
    public BSTNode (int key, Object value, BSTNode left, BSTNode right) {
        this.key = key;
        this.value = value;
        this.left = left;
        this.right = right;
    }
    
    public int getKey () {
        return key;
    }
    
    public void setKey (int key) {
        this.key = key;
    }
    
    public Object getValue () {
        return value;
    }
    
    public void setValue (Object value) {
        this.value = value;
    }
    
    public BSTNode getLeft () {
        return left;
    }
    
    public void setLeft (BSTNode left) {
        this.left = left;
    }
    
    public BSTNode getRight () {
        return right;
    }
    
    public void setRight (BSTNode right) {
        this.right = right;
    }
    
    @Override
    public String toString () {
        return "BSTNode{" +
              "key=" + key +
              ", value=" + value +
              ", left=" + left +
              ", right=" + right +
              '}';
    }
}
